import request from '@/utils/request'

// 查询租赁意向列表
export function listApply(query) {
  return request({
    url: '/parking/apply/list',
    method: 'get',
    params: query
  })
}

// 查询租赁意向详细
export function getApply(id) {
  return request({
    url: '/parking/apply/' + id,
    method: 'get'
  })
}

// 新增租赁意向
export function sendMyApply(data) {
  return request({
    url: '/parking/apply/sendMyApply',
    method: 'post',
    data: data
  })
}

// 修改租赁意向
export function updateApply(data) {
  return request({
    url: '/parking/apply/mine',
    method: 'put',
    data: data
  })
}

// 删除租赁意向
export function delApply(id) {
  return request({
    url: '/parking/apply/mine/' + id,
    method: 'delete'
  })
}

// 查询我的某个车位租赁意向列表
export function getMyApplyBySpotId(query) {
  return request({
    url: '/parking/apply/getMyApplyBySpotId',
    method: 'get',
    params: query
  })
}

// 查询租赁发出的意向列表
export function listSendApply(query) {
  return request({
    url: '/parking/apply/listSendApply',
    method: 'get',
    params: query
  })
}

// 查询收到的租赁意向列表
export function listReceivedApply(query) {
  return request({
    url: '/parking/apply/listReceivedApply',
    method: 'get',
    params: query
  })
}